package com.itheima.wemedia.controller;


import com.itheima.common.vo.ResultVo;
import com.itheima.core.controller.AbstractCoreController;

import com.itheima.wemedia.pojo.WmUser;
import com.itheima.wemedia.service.WmUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description <p>自媒体用户信息</p>
 *
 * @version 1.0
 * @package com.itheima.wemedia.controller
 */
@Api(value="WmUserController",tags = "自媒体用户信息")
@RestController
@RequestMapping("/wmUser")
public class WmUserController extends AbstractCoreController<WmUser> {

    @Autowired
    private WmUserService wmUserService;

    @Autowired
    public WmUserController(WmUserService wmUserService) {
        super(wmUserService);
        this.wmUserService=wmUserService;
    }

    /**
     * 根据apUserId获取
     * @param apUserId
     * @return
     */
    @GetMapping("/one/{apUserId}")
    public ResultVo<WmUser> getByApUserId(@PathVariable(name="apUserId") Integer apUserId){
        WmUser wmUser = wmUserService.getByApUserId(apUserId);
        return ResultVo.ok(wmUser);
    }

}

